﻿package game.popups 
{
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	/**
	 * ...
	 * @author Doan Nguyen Thuy Nha Truc (Bamboo)
	 * @author Nguyen Thi Bich Phuong (Daisy)
	 */
	public class MessagePopup extends MovieClip
	{
		public var titleTf:TextField;
		public var messageTf:TextField;
		public var textOkBtn:TextField;
		public var okBtn:SimpleButton;
		public function MessagePopup() 
		{
			hide();
			textOkBtn.mouseEnabled = false;
			okBtn.addEventListener(MouseEvent.CLICK, hdlBtnOkClick);
		}
		/**
		 * @author	Bamboo
		 * @param	e
		 */
		private function hdlBtnOkClick(e:MouseEvent):void 
		{
			hide();
		}
		/**
		 * @author	Bamboo
		 */
		public function hide():void {
			//trace("hide");
			this.visible = false;
		}
		/**
		 * @author	Bamboo
		 */
		public function show():void {
			this.visible = true;
		}
		/**
		 * @author	Bamboo
		 * @param	msg
		 */
		public function showMessage(msg:String):void {
			messageTf.text = msg;
			show();
			
		}
		/**
		 * @author
		 */
		public function updateLable(title:String, textOk:String):void {
			this.titleTf.text = title;
			this.textOkBtn.text = textOk;
		}
	}

}